'use strict';

const { start } = require('egg');

const Service = require('egg').Service;

class HomeService extends Service {
    async list(pagenum,limit) {
        let startIndex = (pagenum-1)*limit;
        return await this.app.mysql.query(`select * from list limit ${startIndex},${limit}`)
    }
    //查询总条数
    async total(){
        return await this.app.mysql.query('select count(*) from list')
    }
}

module.exports = HomeService;
